//
//  WSJConversionCell.m
//  WCN
//
//  Created by wsj2015 on 16/7/8.
//  Copyright © 2016年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WSJConversionCell.h"
#import "WCImageView +setImage.h"

@implementation WSJConversionCell

- (void)awakeFromNib {
    // Initialization code
    
    
    wsj_cornerRadius(self.avatarImageView, 22);
    wsj_cornerRadius(self.tagLabel, 2);
    wsj_cornerRadius(self.countLabel, 8);
    
    
    
}

- (void)setModel:(WSJConversion *)conversation{

    self.nameLabel.text = [conversation.patientName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];;
    self.detalL.text = [conversation.detailText stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    self.detalL.textColor = [UIColor grayColor];
    
    [self.avatarImageView  wsjSetImageWithUrl:conversation.avatarUrl withPlaceImageName:@"avatar"];
    if ([conversation.unread integerValue] > 0) {
        self.nameLabel.textColor = [UIColor redColor];
        self.tagLabel.hidden = NO;
        self.countLabel.text =[NSString stringWithFormat:@"%@",conversation.unread];
       self.countLabel.hidden = NO;
        
       
        
    } else {
         self.nameLabel.textColor = [UIColor blackColor];
        self.countLabel.hidden = YES;
         self.tagLabel.hidden = YES;
    }
    
}

@end
